package pers.cz.chat.filter;

import io.netty.channel.Channel;
import pers.cz.chat.constants.JefClolorEnum;
import pers.cz.chat.utils.LogUtils;
import pers.cz.netty.filter.FilterHandler;
import pers.cz.netty.filter.FilterHandlerContext;
import pers.cz.netty.protocal.Message;
import pers.cz.netty.protocal.MsgType;

/**
 * @version 1.0
 * @description: 接收注册消息
 * @author: ChengZhi 0336
 * @create: 2025-01-09 11:38
 **/
public class RegistReceiveFilter implements FilterHandler<Message, Channel> {

	@Override
	public boolean approve(Message message, Channel obj, FilterHandlerContext<Message, Channel> handlerContext) {

		if (MsgType.REGIST.equals(message.getMsgType())) {
			LogUtils.print(JefClolorEnum.GREEN,"注册成功！，请登录");
		}
		return handlerContext.doFilter(message, obj);
	}
}
